<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> {yun:}include file="$lietoustyle/public.htm"{/yun}
        <link rel="stylesheet" href="{yun:}$lietou_style{/yun}/css/jianli.css?v={yun:}$config.cachecode{/yun}" type="text/css">
        <script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/member_public.js?v={yun:}$config.cachecode{/yun}"></script>
    </head>

    <body>
        {yun:}include file="$lietoustyle/header.htm"{/yun}
        <div class="m_content">
            <div class="wrap">
                {yun:}include file="$lietoustyle/left.htm"{/yun}
                <div class="m_inner_youb fl">
                    <div class=admincont_box>
                        <div class="lt_m_tit"><span class="lt_m_tit_s">收银台</span></div>
						
						<iframe id="supportiframe" name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
                        <form name="alipayment" class="layui-form" id="payform" action="" method="post" onsubmit="return paymentforms();" enctype="multipart/form-data">

                            <div class="clear"></div>

                            <div class="payment_boxtable">
                                <table class="" cellpadding="1" cellspacing="1" border="0">
                                    <tr>
                                        <th>订单编号</th>
                                        <th>购买商品</th>
                                        <th>金额</th>
                                    </tr>
                                    <tr>
                                        <td>{yun:}$order.order_id{/yun}</td>
                                        <td>
                                            <div class="pay_ment">
                                                {yun:}if $order.type==1{/yun}购买会员 {yun:}elseif $order.type=='2'{/yun}{yun:}$order.integral{/yun}{yun:}$config.integral_priceunit{/yun}{yun:}$config.integral_pricename{/yun} {yun:}elseif $order.type=='3'{/yun}银行转帐 {yun:}elseif $order.type=='4'{/yun}金额充值 {yun:}elseif $order.type=='5'{/yun}增值服务 {yun:}elseif $order.type=='6'{/yun}课程订购 {yun:}elseif $order.type=='18'{/yun}职位刷新 {yun:}elseif $order.type=='19'{/yun}下载简历 {yun:}elseif $order.type=='22'{/yun}发布职位 {yun:}/if{/yun}
                                            </div>
                                            <input type="hidden" name="dingdan" value="{yun:}$order.order_id{/yun}" />
                                            <input type="hidden" name="aliorder" value="{yun:}$order.order_id{/yun}" />
                                            <input type="hidden" name="oid" id="oid"value="{yun:}$order.id{/yun}" />
                                            <input type="hidden" name="alimoney" value="{yun:}$order.order_price{/yun}" />
                                            <input type="hidden" name="paytype" id="paytype" value="" />
                                            <input type="hidden" name="subject" value="{yun:}if $order.type==1{/yun}购买会员 {yun:}elseif $order.type=='2'{/yun}{yun:}$order.integral{/yun}{yun:}$config.integral_priceunit{/yun}{yun:}$config.integral_pricename{/yun} {yun:}elseif $order.type=='3'{/yun}银行转帐 {yun:}elseif $order.type=='4'{/yun}金额充值 {yun:}elseif $order.type=='5'{/yun}增值服务 {yun:}elseif $order.type=='6'{/yun}课程订购 {yun:}elseif $order.type=='18'{/yun}职位刷新 {yun:}elseif $order.type=='19'{/yun}下载简历 {yun:}elseif $order.type=='22'{/yun}发布职位 {yun:}/if{/yun}" />
                                        </td>
                                        <td>￥{yun:}$order.order_price{/yun}</td>
                                    </tr>
                                </table>

								<div class='clear'></div>
								
                                <div class="payment_boxlist_fk">
                                	实付款
                                    <span class="payment_boxlist_fk_n">￥
          							<span id="order_price">{yun:}$order.order_price{/yun}</span>
                                    </span>
                                </div>
								
								{yun:}if $config.tenpay=='1'||$config.bank=='1'||$config.alipay=='1' || $config.wxpay=='1'{/yun}

                                <div class="payment_boxlist_zf" id="pay_style">
									{yun:}if $config.bank=='1'&&is_array($rows)&&$rows{/yun}<span class="payment_boxlist_zf_s" id="otherpay" onclick="paycheck('otherpay');"><i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_qt"></i>其他支付方式</span>{yun:}/if{/yun}
									{yun:}if $config.tenpay=='1'{/yun}<span class="payment_boxlist_zf_s" id="tenpay" onclick="paycheck('tenpay');"><i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_cft"></i>财付通支付</span>{yun:}/if{/yun}
									{yun:}if $config.wxpay=='1'{/yun}<span class="payment_boxlist_zf_s" id="wxpay" onclick="paycheck('wxpay');"><i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_wx"></i>微信支付</span>{yun:}/if{/yun}
									{yun:}if $config.alipay=='1'{/yun}<span class="payment_boxlist_zf_s" id="alipay" onclick="paycheck('alipay');"><i class="payment_boxlist_zf_icon payment_boxlist_zf_icon_zfb"></i>支付宝支付</span>{yun:}/if{/yun}
								</div>


                                <div class="bank_box other_pay" style="display: none;">
                                    <table width="100%" border="0" cellpadding="1" cellspacing="1" class="my_table_msg" style="background:#ddd">
                                        <tr>
                                            <th width="8%" height="30" align="center" bgcolor="#F7FAFF">银行名称</th>
                                            <th width="5%" height="30" align="center" bgcolor="#F7FAFF">开户人</th>
                                            <th width="12%" align="center" bgcolor="#F7FAFF">银行帐户</th>
                                            <th width="14%" align="center" bgcolor="#F7FAFF">开户行</th>
                                        </tr>
                                        {yun:}if is_array($rows){/yun} {yun:}foreach item=blist from=$rows{/yun}
                                        <tr>
                                            <td height="30" align="center" bgcolor="#FFFFFF">{yun:}$blist.bank_name{/yun}</td>
                                            <td height="30" align="center" bgcolor="#FFFFFF">{yun:}$blist.name{/yun}</td>
                                            <td align="center" bgcolor="#FFFFFF">{yun:}$blist.bank_number{/yun}</td>
                                            <td align="center" bgcolor="#FFFFFF">{yun:}$blist.bank_address{/yun}</td>
                                        </tr>
                                        {yun:}/foreach{/yun} {yun:}else{/yun}
                                        <tr>
                                            <td colspan="4" height="26" align="center" bgcolor="#FFFFFF">暂未添加银行</td>
                                        </tr>
                                        {yun:}/if{/yun}
                                    </table>

                                    <div class="bank_list_p_box">

                                        <div class="bank_list_p">
                                            <span class="bank_list_p_s">汇款银行：</span>
											<div class="layui-input-inline">
												<select name="banks" lay-filter="banks">
													<option value="">请选择汇款银行</option>
													{yun:}foreach from=$rows key=j item=v{/yun}
													<option value="{yun:}$v.bank_name{/yun}+{yun:}$v.bank_number{/yun}" >{yun:}$v.bank_name{/yun}</option>
													{yun:}/foreach{/yun}
												</select>
												<input type="hidden" name="bank_name" id="bank_name" value="">	
											</div>
                                        </div>
                                        <div class="bank_list_p">
                                            <span class="bank_list_p_s">汇入账号：</span>
                                            <input type="text" id="bank_number" name="bank_number" class="bank_list_text" onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')" value="{yun:}$order.bank_number{/yun}" />
                                        </div>
                                        <div class="bank_list_p">
                                            <span class="bank_list_p_s">汇款金额：</span>
                                            <input type="text" id="bank_price" name="bank_price" class="bank_list_text" value="{yun:}$order.order_price{/yun}" />
                                        </div>
                                        <div class="bank_list_p">
                                            <span class="bank_list_p_s">汇款时间：</span>
                                            <input type="text" id="bank_time" name="bank_time" class="bank_list_text" />
                                        </div>
                                        <div class="bank_list_p">
                                            <span class="bank_list_p_s">备注</span>
                                            <textarea name='order_remark' class="bank_textarea"></textarea>
                                        </div>
                                        <div class="bank_list_p">
                                            <span class="bank_list_p_s">上传汇款单：</span>
                                            <button type="button" class="layui-btn layui-btn-normal noupload" lay-data="{imgid: 'imgicon',parentid: 'imgparent'}">选择文件</button>
                                            <input type="hidden" id="laynoupload" value="1" />
                                       <span id="imgparent" class=" none"> 
                                          <img id="imgicon" src="" width="38" height="38"> 
                                        </span>  </div>
                                       
                                        <script type="text/javascript">
                                            layui.use(['laydate'], function() {
                                                var laydate = layui.laydate,
                                                    $ = layui.$;
                                                laydate.render({
                                                    elem: '#bank_time'
                                                });
                                            });
                                        </script>

                                    </div>
                                </div>

                                <div class="payment_boxlist_zf_bth" id="order_pay">
                                    <input type="button" value="确认支付" class="payment_boxlist_zf_bth_a" onclick="CheckForm();" />
                                </div>
                                 
								{yun:}else{/yun}
									<div class="con_banner_no" style="width:300px;"><span></span><em>网站已关闭支付接口，请联系管理员</em></div>
								{yun:}/if{/yun}
								
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <div class="clear"></div>

        <!--  微信tck-->
        <div id="wxpayTx" style="display:none;">
            <div class="wx_payment" style="width:250px; padding: 10px 15px;">
                <div class="wx_payment_cont" style="width:250px">
                    <div class="wx_payment_ewm">正在加载微信二维码,请稍候....</div>
                </div>
                <div class="wx_payment_h2" style="width:250px">二维码有效时长为2小时，请尽快支付</div>
                <div class="wx_payment_tip" style="margin-left:40px;">
                    <div class="wx_payment_tip_left"><i class="wx_payment_tip_line1"></i><i class="wx_payment_tip_line2"></i><i class="wx_payment_tip_line3"></i></div>
                    <div class="wx_payment_tip_right">请使用微信扫一扫<br>扫描二维码支付</div>
                </div>
            </div>
        </div>

        <!--支付弹出框-->
        <div id="payshow" style="width:450px; position:absolute;left:0px;top:0px; background:#fff; display:none;">
            <div class="payment_tip">请在新打开的支付页面上完成付款，付款完成前请不要关闭此窗口。<br>如您在支付过程中遇到问题，请联系客服：<span class="payment_tip_s">{yun:}$config.sy_freewebtel{/yun}</span></div>
            <div class="payment_bottom">
                <a href="index.php?c=paylog" class="payment_bottombutt">已完成付款</a>
                <a href="index.php?c=payment&id={yun:}$order.id{/yun}" class="payment_bottom_bth2">重新支付</a>
            </div>
        </div>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui.upload.js?v={yun:}$config.cachecode{/yun}" type='text/javascript'></script>
<script>
function paycheck(type) {
	if(type == "wxpay") {
		document.getElementById('payform').action = "";
		$("#payform").attr("target", "supportiframe");
		$("#wxpay").addClass("payment_boxlist_zf_s_cur");
		 $("#otherpay").removeClass("payment_boxlist_zf_s_cur");
		$("#tenpay").removeClass("payment_boxlist_zf_s_cur");
		 $("#alipay").removeClass("payment_boxlist_zf_s_cur");
		 $("#paytype").val("wxpay");
		 $(".other_pay").hide();
	} else if(type == "alipay") {
		document.getElementById('payform').action = "../api/alipay/alipayto.php";
		$("#payform").attr("target", "_blank");
		$("#alipay").addClass("payment_boxlist_zf_s_cur");
		$("#otherpay").removeClass("payment_boxlist_zf_s_cur");
		$("#tenpay").removeClass("payment_boxlist_zf_s_cur");
		$("#wxpay").removeClass("payment_boxlist_zf_s_cur");
		$("#paytype").val("alipay");
		$(".other_pay").hide();
	} else if(type == "tenpay") {
		document.getElementById('payform').action = "../api/tenpay/index.php";
		$("#payform").attr("target", "_blank");
		$("#tenpay").addClass("payment_boxlist_zf_s_cur");
		$("#otherpay").removeClass("payment_boxlist_zf_s_cur");
		$("#alipay").removeClass("payment_boxlist_zf_s_cur");
		$("#wxpay").removeClass("payment_boxlist_zf_s_cur");
		$("#paytype").val("tenpay");
		$(".other_pay").hide();
	} else if(type == "otherpay") {
		document.getElementById('payform').action = "index.php?c=payment&act=paybank";
		$("#payform").attr("target", "supportiframe");
		$("#otherpay").addClass("payment_boxlist_zf_s_cur");
		$("#alipay").removeClass("payment_boxlist_zf_s_cur");
		$("#tenpay").removeClass("payment_boxlist_zf_s_cur");
		$("#wxpay").removeClass("payment_boxlist_zf_s_cur");
		$("#paytype").val("bank");
		$(".other_pay").show();
	}
}

	function CheckForm(){
		var oid		=	$("input[name=oid]").val();
		var paytype = 	$("input[name=paytype]").val(); 
		var index	=	loadlayer();
		$.ajax({
			async: false, //设置ajax同步  
			type: 'POST',  
			global:false,
			url: weburl+"/member/index.php?m=ajax&c=order_type",  
			data: {oid:oid,paytype:paytype},  
			success: function(data){
				layer.close(index);
			
 				$('#payform').submit();
			}  
		});
	}


	function paymentforms() {
		var id = '{yun:}$order.id{/yun}';
		var integral = $("#i_integral").val();
		var pay_bank = $("#paytype").val();
						
		if(pay_bank == '') {
			layer.msg('请选择支付方式！', 2, 8);return false;
		} else if(pay_bank == 'bank') {
			if($("#bank_name").val() == "") {
					layer.msg('请填写汇款银行！', 2, 8);return false;
			}
			if($("#bank_number").val() == "") {
				layer.msg('请填写汇入账号！', 2, 8);return false;
			}
			if($("#bank_price").val() == "") {
				layer.msg('请填写汇款金额！', 2, 8);return false;
			}
			if($("#bank_time").val() == "") {
				layer.msg('请填写汇款时间！', 2, 8);return false;
			}
		}
		
		if(pay_bank == 'wxpay') {
			var orderId = '{yun:}$order.id{/yun}';
			var coupon = $("input[name='coupon']:checked").val();
			$.post('index.php?c=payment&act=wxurl', {
				orderId: orderId,
				coupon: coupon
			}, function(data) {
				$('.wx_payment_ewm').html(data);
				$.layer({
					type: 1,
					title: '微信扫码支付',
					closeBtn: [0, true],
					border: [10, 0.3, '#000', true],
					area: ['320px', '400px'],
					page: {
						dom: "#wxpayTx"
					}
				});
				setInterval("wxorderstatus(" + orderId + ")", 3000);
			})
			return false;
		} else if(pay_bank !='bank'){
			$.layer({
				type: 1,
				title: '提示',
				closeBtn: [0, true],
				border: [10, 0.3, '#000', true],
				area: ['450px', '280px'],
				page: {dom: "#payshow"}
			});
		}
	}

	function wxorderstatus(orderid) {
		$.post('{yun:}$config.sy_weburl{/yun}/api/wxpay/wxorder.php', {
			orderid: orderid
		}, function(data) {
			if(data == 1) {
				window.location.href = '';
			}
		});
	}

	layui.use(['form'], function() {
		var form = layui.form,
			layer = layui.layer,
			$ = layui.$;
		form.on('select(banks)', function(data){
			if(data.value){
				var bank = data.value.split("+");
				
				$("#bank_name").val(bank[0]);
				$("#bank_number").val(bank[1]);
				form.render('select');
			}
		});
	});

	 
</script>
{yun:}include file="$lietoustyle/footer.htm"{/yun}